package UI;
import java.awt.FlowLayout;
import java.awt.Choice;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.Font;
import java.awt.Color;

import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JSlider;
import javax.swing.JSeparator;
import javax.swing.JRadioButton;
import javax.swing.JButton;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.SwingConstants;

public class Panel {
        private JPanel panelPc;
        private JPanel panelPort;
        private JPanel panelQueue; 
        private JPanel panelTask;
        private JPanel panelYourQueue;
        private JPanel panelSent;
        private JPanel panelParameter;
        
        /**
         * Create the application.
         */
        public Panel() {
        	initialize();
        }

        /**
         * Initialize the contents of the frame.
         */
        private void initialize() {
        	JFrame frmProva = new JFrame();
        	frmProva.setTitle("PROVA");
        	frmProva.setBounds(100, 100, 700, 500);
        	frmProva.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        	frmProva.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
        	
        	/**
        	 *	Panel to view element in queue, both task and event, and their status
        	 *	It contains three label to indicate level of the queue
        	 */              
        	
        	panelTask = new JPanel();
        	frmProva.getContentPane().add(panelTask);
        	GridBagLayout gbl_panelTask = new GridBagLayout();
        	gbl_panelTask.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
        	gbl_panelTask.columnWidths = new int[]{20, 94, 122, 59, 106, 47, 20};
        	gbl_panelTask.rowHeights = new int[]{20, 0, 30, 20, 15, 20, 14, 20, 0, 20, 17, 14, 14, 0};
        	gbl_panelTask.columnWeights = new double[]{0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0};
        	gbl_panelTask.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panelTask.setLayout(gbl_panelTask);
        	
        	JLabel lblDescriptionTask = new JLabel("Insert a task and set Nodes than can be able to execute it");
        	lblDescriptionTask.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblDescriptionTask = new GridBagConstraints();
        	gbc_lblDescriptionTask.gridwidth = 5;
        	gbc_lblDescriptionTask.insets = new Insets(0, 0, 5, 5);
        	gbc_lblDescriptionTask.gridx = 1;
        	gbc_lblDescriptionTask.gridy = 1;
        	panelTask.add(lblDescriptionTask, gbc_lblDescriptionTask);
        	
        	JSeparator separator_14 = new JSeparator();
        	GridBagConstraints gbc_separator_14 = new GridBagConstraints();
        	gbc_separator_14.anchor = GridBagConstraints.NORTH;
        	gbc_separator_14.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_14.gridwidth = 5;
        	gbc_separator_14.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_14.gridx = 1;
        	gbc_separator_14.gridy = 2;
        	panelTask.add(separator_14, gbc_separator_14);
        	
        	JLabel lblInsertTask = new JLabel("Insert Task");
        	lblInsertTask.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblInsertTask = new GridBagConstraints();
        	gbc_lblInsertTask.gridwidth = 5;
        	gbc_lblInsertTask.insets = new Insets(0, 0, 5, 5);
        	gbc_lblInsertTask.gridx = 1;
        	gbc_lblInsertTask.gridy = 3;
        	panelTask.add(lblInsertTask, gbc_lblInsertTask);
        	
        	JSeparator separator_6 = new JSeparator();
        	GridBagConstraints gbc_separator_6 = new GridBagConstraints();
        	gbc_separator_6.gridwidth = 5;
        	gbc_separator_6.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_6.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_6.gridx = 1;
        	gbc_separator_6.gridy = 4;
        	panelTask.add(separator_6, gbc_separator_6);
        	
        	JRadioButton rdbtnEnqueue = new JRadioButton("Enqueue :");
        	rdbtnEnqueue.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_rdbtnEnqueue = new GridBagConstraints();
        	gbc_rdbtnEnqueue.anchor = GridBagConstraints.WEST;
        	gbc_rdbtnEnqueue.insets = new Insets(0, 0, 5, 5);
        	gbc_rdbtnEnqueue.gridx = 1;
        	gbc_rdbtnEnqueue.gridy = 5;
        	panelTask.add(rdbtnEnqueue, gbc_rdbtnEnqueue);
        	
        	JTextField textField_14 = new JTextField();
        	GridBagConstraints gbc_textField_14 = new GridBagConstraints();
        	gbc_textField_14.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_14.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_14.gridx = 2;
        	gbc_textField_14.gridy = 5;
        	panelTask.add(textField_14, gbc_textField_14);
        	textField_14.setColumns(10);
        	
        	JRadioButton rdbtnDequeue = new JRadioButton("Dequeue");
        	rdbtnDequeue.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_rdbtnDequeue = new GridBagConstraints();
        	gbc_rdbtnDequeue.anchor = GridBagConstraints.WEST;
        	gbc_rdbtnDequeue.insets = new Insets(0, 0, 5, 5);
        	gbc_rdbtnDequeue.gridx = 4;
        	gbc_rdbtnDequeue.gridy = 5;
        	panelTask.add(rdbtnDequeue, gbc_rdbtnDequeue);
        	
        	ButtonGroup group = new ButtonGroup();
            group.add(rdbtnEnqueue);
            group.add(rdbtnDequeue);
        	
        	JSeparator separator_7 = new JSeparator();
        	GridBagConstraints gbc_separator_7 = new GridBagConstraints();
        	gbc_separator_7.gridwidth = 5;
        	gbc_separator_7.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_7.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_7.gridx = 1;
        	gbc_separator_7.gridy = 6;
        	panelTask.add(separator_7, gbc_separator_7);
        	
        	JLabel lblFilter = new JLabel("Filter");
        	lblFilter.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblFilter = new GridBagConstraints();
        	gbc_lblFilter.gridwidth = 5;
        	gbc_lblFilter.insets = new Insets(0, 0, 5, 5);
        	gbc_lblFilter.gridx = 1;
        	gbc_lblFilter.gridy = 8;
        	panelTask.add(lblFilter, gbc_lblFilter);
        	
        	JSeparator separator = new JSeparator();
        	GridBagConstraints gbc_separator = new GridBagConstraints();
        	gbc_separator.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator.insets = new Insets(0, 0, 5, 5);
        	gbc_separator.gridwidth = 5;
        	gbc_separator.gridx = 1;
        	gbc_separator.gridy = 9;
        	panelTask.add(separator, gbc_separator);
        	
        	JLabel lblNewLabel_12 = new JLabel("CPU");
        	lblNewLabel_12.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	GridBagConstraints gbc_lblNewLabel_12 = new GridBagConstraints();
        	gbc_lblNewLabel_12.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_12.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_12.gridx = 1;
        	gbc_lblNewLabel_12.gridy = 10;
        	panelTask.add(lblNewLabel_12, gbc_lblNewLabel_12);
        	
        	Choice choice_3 = new Choice();
        	choice_3.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	choice_3.addItem("Anything");
        	choice_3.addItem("1 core");
        	choice_3.addItem("2 core");
        	choice_3.addItem("4 core");
        	choice_3.addItem("More");
        	
        	GridBagConstraints gbc_choice_3 = new GridBagConstraints();
        	gbc_choice_3.anchor = GridBagConstraints.SOUTH;
        	gbc_choice_3.fill = GridBagConstraints.HORIZONTAL;
        	gbc_choice_3.insets = new Insets(0, 0, 5, 5);
        	gbc_choice_3.gridx = 2;
        	gbc_choice_3.gridy = 10;
        	panelTask.add(choice_3, gbc_choice_3);
        	
        	JSeparator separator_3 = new JSeparator();
        	GridBagConstraints gbc_separator_3 = new GridBagConstraints();
        	gbc_separator_3.gridwidth = 3;
        	gbc_separator_3.insets = new Insets(0, 0, 5, 0);
        	gbc_separator_3.gridx = 4;
        	gbc_separator_3.gridy = 10;
        	panelTask.add(separator_3, gbc_separator_3);
        	
        	JLabel lblNewLabel_13 = new JLabel("Frequency");
        	lblNewLabel_13.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	GridBagConstraints gbc_lblNewLabel_13 = new GridBagConstraints();
        	gbc_lblNewLabel_13.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_13.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_13.gridx = 1;
        	gbc_lblNewLabel_13.gridy = 11;
        	panelTask.add(lblNewLabel_13, gbc_lblNewLabel_13);
        	
        	Choice choice_1 = new Choice();
        	choice_1.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	choice_1.addItem("Anything");
        	choice_1.addItem(" < 1 GHz");
        	choice_1.addItem("1 GHz - 2GHz");
        	choice_1.addItem(" > 2 GHz");
        	GridBagConstraints gbc_choice_1 = new GridBagConstraints();
        	gbc_choice_1.anchor = GridBagConstraints.SOUTH;
        	gbc_choice_1.fill = GridBagConstraints.HORIZONTAL;
        	gbc_choice_1.insets = new Insets(0, 0, 5, 5);
        	gbc_choice_1.gridx = 2;
        	gbc_choice_1.gridy = 11;
        	panelTask.add(choice_1, gbc_choice_1);
        	
        	Choice choice_2 = new Choice();
        	choice_2.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	choice_2.addItem("Anything");
        	choice_2.addItem("512 MB");
        	choice_2.addItem("1 GB");
        	choice_2.addItem("2 GB");
        	choice_2.addItem("More");
        	
        	JButton button = new JButton("SEND");
        	button.addMouseListener(new MouseAdapter() {
        		@Override
        		public void mouseReleased(MouseEvent e) {
        			// TODO: send task
        		}
        	});
        	button.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	GridBagConstraints gbc_button = new GridBagConstraints();
        	gbc_button.anchor = GridBagConstraints.NORTH;
        	gbc_button.fill = GridBagConstraints.HORIZONTAL;
        	gbc_button.insets = new Insets(0, 0, 5, 5);
        	gbc_button.gridx = 4;
        	gbc_button.gridy = 11;
        	panelTask.add(button, gbc_button);
        	
        	JLabel lblNewLabel_14 = new JLabel("Memory");
        	lblNewLabel_14.setFont(new Font("Tahoma", Font.PLAIN, 13));
        	GridBagConstraints gbc_lblNewLabel_14 = new GridBagConstraints();
        	gbc_lblNewLabel_14.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_14.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_14.gridx = 1;
        	gbc_lblNewLabel_14.gridy = 12;
        	panelTask.add(lblNewLabel_14, gbc_lblNewLabel_14);
        	GridBagConstraints gbc_choice_2 = new GridBagConstraints();
        	gbc_choice_2.anchor = GridBagConstraints.SOUTH;
        	gbc_choice_2.fill = GridBagConstraints.HORIZONTAL;
        	gbc_choice_2.insets = new Insets(0, 0, 5, 5);
        	gbc_choice_2.gridx = 2;
        	gbc_choice_2.gridy = 12;
        	panelTask.add(choice_2, gbc_choice_2);
        	
        	panelSent = new JPanel();
        	frmProva.getContentPane().add(panelSent);
        	GridBagLayout gbl_panelSent = new GridBagLayout();
        	gbl_panelSent.columnWidths = new int[]{20, 230, 39, 230, 20, 0};
        	gbl_panelSent.rowHeights = new int[]{20, 0, 13, 27, 12, 315, 20, 0};
        	gbl_panelSent.columnWeights = new double[]{0.0, 1.0, 1.0, 1.0, 0.0, Double.MIN_VALUE};
        	gbl_panelSent.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE};
        	panelSent.setLayout(gbl_panelSent);
        	
        	JLabel lblViewYourTask = new JLabel("View your task and event sent with the return status");
        	lblViewYourTask.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblViewYourTask = new GridBagConstraints();
        	gbc_lblViewYourTask.gridwidth = 3;
        	gbc_lblViewYourTask.insets = new Insets(0, 0, 5, 5);
        	gbc_lblViewYourTask.gridx = 1;
        	gbc_lblViewYourTask.gridy = 1;
        	panelSent.add(lblViewYourTask, gbc_lblViewYourTask);
        	
        	JSeparator separator_9 = new JSeparator();
        	GridBagConstraints gbc_separator_9 = new GridBagConstraints();
        	gbc_separator_9.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_9.gridwidth = 3;
        	gbc_separator_9.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_9.gridx = 1;
        	gbc_separator_9.gridy = 2;
        	panelSent.add(separator_9, gbc_separator_9);
        	
        	JLabel lblTask = new JLabel("TASK");
        	lblTask.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblTask = new GridBagConstraints();
        	gbc_lblTask.anchor = GridBagConstraints.SOUTH;
        	gbc_lblTask.insets = new Insets(0, 0, 5, 5);
        	gbc_lblTask.gridx = 1;
        	gbc_lblTask.gridy = 3;
        	panelSent.add(lblTask, gbc_lblTask);
        	
        	JLabel lblEvent = new JLabel("EVENT");
        	lblEvent.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblEvent = new GridBagConstraints();
        	gbc_lblEvent.anchor = GridBagConstraints.SOUTH;
        	gbc_lblEvent.insets = new Insets(0, 0, 5, 5);
        	gbc_lblEvent.gridx = 3;
        	gbc_lblEvent.gridy = 3;
        	panelSent.add(lblEvent, gbc_lblEvent);
        	
        	JSeparator separator_4 = new JSeparator();
        	GridBagConstraints gbc_separator_4 = new GridBagConstraints();
        	gbc_separator_4.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_4.anchor = GridBagConstraints.NORTH;
        	gbc_separator_4.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_4.gridx = 1;
        	gbc_separator_4.gridy = 4;
        	panelSent.add(separator_4, gbc_separator_4);
        	
        	JSeparator separator_5 = new JSeparator();
        	GridBagConstraints gbc_separator_5 = new GridBagConstraints();
        	gbc_separator_5.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_5.anchor = GridBagConstraints.NORTH;
        	gbc_separator_5.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_5.gridx = 3;
        	gbc_separator_5.gridy = 4;
        	panelSent.add(separator_5, gbc_separator_5);
        	
        	JPanel panel_2 = new JPanel();
        	panel_2.setBorder(new LineBorder(new Color(0, 0, 0)));
        	panel_2.setBackground(Color.WHITE);
        	GridBagConstraints gbc_panel_2 = new GridBagConstraints();
        	gbc_panel_2.insets = new Insets(0, 0, 5, 5);
        	gbc_panel_2.fill = GridBagConstraints.BOTH;
        	gbc_panel_2.gridx = 1;
        	gbc_panel_2.gridy = 5;
        	panelSent.add(panel_2, gbc_panel_2);
        	GridBagLayout gbl_panel_2 = new GridBagLayout();
        	gbl_panel_2.columnWidths = new int[]{114, 114, 0};
        	gbl_panel_2.rowHeights = new int[]{25, 0};
        	gbl_panel_2.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
        	gbl_panel_2.rowWeights = new double[]{0.0, Double.MIN_VALUE};
        	panel_2.setLayout(gbl_panel_2);
        	
        	JLabel lblInstruction = new JLabel("Instruction");
        	lblInstruction.setFont(new Font("Tahoma", Font.BOLD, 11));
        	GridBagConstraints gbc_lblInstruction = new GridBagConstraints();
        	gbc_lblInstruction.insets = new Insets(0, 0, 0, 5);
        	gbc_lblInstruction.gridx = 0;
        	gbc_lblInstruction.gridy = 0;
        	panel_2.add(lblInstruction, gbc_lblInstruction);
        	
        	JLabel lblStatus = new JLabel("Status");
        	lblStatus.setFont(new Font("Tahoma", Font.BOLD, 11));
        	GridBagConstraints gbc_lblStatus = new GridBagConstraints();
        	gbc_lblStatus.gridx = 1;
        	gbc_lblStatus.gridy = 0;
        	panel_2.add(lblStatus, gbc_lblStatus);
        	
        	JPanel panel_3 = new JPanel();
        	panel_3.setBorder(new LineBorder(new Color(0, 0, 0)));
        	panel_3.setBackground(Color.WHITE);
        	GridBagConstraints gbc_panel_3 = new GridBagConstraints();
        	gbc_panel_3.insets = new Insets(0, 0, 5, 5);
        	gbc_panel_3.fill = GridBagConstraints.BOTH;
        	gbc_panel_3.gridx = 3;
        	gbc_panel_3.gridy = 5;
        	panelSent.add(panel_3, gbc_panel_3);
        	GridBagLayout gbl_panel_3 = new GridBagLayout();
        	gbl_panel_3.columnWidths = new int[]{114, 114, 0};
        	gbl_panel_3.rowHeights = new int[]{25, 0};
        	gbl_panel_3.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
        	gbl_panel_3.rowWeights = new double[]{0.0, Double.MIN_VALUE};
        	panel_3.setLayout(gbl_panel_3);
        	
        	JLabel lblInstruction_1 = new JLabel("Instruction");
        	lblInstruction_1.setFont(new Font("Tahoma", Font.BOLD, 11));
        	GridBagConstraints gbc_lblInstruction_1 = new GridBagConstraints();
        	gbc_lblInstruction_1.insets = new Insets(0, 0, 0, 5);
        	gbc_lblInstruction_1.gridx = 0;
        	gbc_lblInstruction_1.gridy = 0;
        	panel_3.add(lblInstruction_1, gbc_lblInstruction_1);
        	
        	JLabel lblStatus_1 = new JLabel("Status");
        	lblStatus_1.setFont(new Font("Tahoma", Font.BOLD, 11));
        	GridBagConstraints gbc_lblStatus_1 = new GridBagConstraints();
        	gbc_lblStatus_1.gridx = 1;
        	gbc_lblStatus_1.gridy = 0;
        	panel_3.add(lblStatus_1, gbc_lblStatus_1);
        	
        	panelPc = new JPanel();
        	frmProva.getContentPane().add(panelPc);
        	GridBagLayout gbl_panelPc = new GridBagLayout();
        	gbl_panelPc.columnWidths = new int[]{30, 50, 130, 30, 150, 50, 30, 0};
        	gbl_panelPc.rowHeights = new int[]{30, 0, 0, 35, 20, 23, 20, 22, 20, 30, 0};
        	gbl_panelPc.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	gbl_panelPc.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panelPc.setLayout(gbl_panelPc);
        	
        	JLabel lblViewYourPersonal = new JLabel("View your personal configuration:");
        	lblViewYourPersonal.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblViewYourPersonal = new GridBagConstraints();
        	gbc_lblViewYourPersonal.gridwidth = 7;
        	gbc_lblViewYourPersonal.insets = new Insets(0, 0, 5, 0);
        	gbc_lblViewYourPersonal.gridx = 0;
        	gbc_lblViewYourPersonal.gridy = 1;
        	panelPc.add(lblViewYourPersonal, gbc_lblViewYourPersonal);
        	
        	JLabel lblOtherNodesCan = new JLabel("other Nodes can choose you reading this internal components");
        	lblOtherNodesCan.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblOtherNodesCan = new GridBagConstraints();
        	gbc_lblOtherNodesCan.gridwidth = 7;
        	gbc_lblOtherNodesCan.insets = new Insets(0, 0, 5, 0);
        	gbc_lblOtherNodesCan.gridx = 0;
        	gbc_lblOtherNodesCan.gridy = 2;
        	panelPc.add(lblOtherNodesCan, gbc_lblOtherNodesCan);
        	
        	JSeparator separator_11 = new JSeparator();
        	GridBagConstraints gbc_separator_11 = new GridBagConstraints();
        	gbc_separator_11.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_11.gridwidth = 7;
        	gbc_separator_11.anchor = GridBagConstraints.NORTH;
        	gbc_separator_11.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_11.gridx = 0;
        	gbc_separator_11.gridy = 3;
        	panelPc.add(separator_11, gbc_separator_11);
        	
        	JLabel lblNewLabel = new JLabel("NCPU");
        	lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
        	gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel.gridx = 2;
        	gbc_lblNewLabel.gridy = 4;
        	panelPc.add(lblNewLabel, gbc_lblNewLabel);
        	
        	JLabel lblNumeroDinamico = new JLabel("numero dinamico");
        	GridBagConstraints gbc_lblNumeroDinamico = new GridBagConstraints();
        	gbc_lblNumeroDinamico.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNumeroDinamico.gridx = 4;
        	gbc_lblNumeroDinamico.gridy = 4;
        	panelPc.add(lblNumeroDinamico, gbc_lblNumeroDinamico);
        	
        	JLabel lblNewLabel_1 = new JLabel("Frequency");
        	lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints();
        	gbc_lblNewLabel_1.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_1.gridx = 2;
        	gbc_lblNewLabel_1.gridy = 6;
        	panelPc.add(lblNewLabel_1, gbc_lblNewLabel_1);
        	
        	JLabel lblNumeroDinamico_1 = new JLabel("numero dinamico");
        	GridBagConstraints gbc_lblNumeroDinamico_1 = new GridBagConstraints();
        	gbc_lblNumeroDinamico_1.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNumeroDinamico_1.gridx = 4;
        	gbc_lblNumeroDinamico_1.gridy = 6;
        	panelPc.add(lblNumeroDinamico_1, gbc_lblNumeroDinamico_1);
        	
        	JLabel lblNewLabel_2 = new JLabel("Memory");
        	lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel_2 = new GridBagConstraints();
        	gbc_lblNewLabel_2.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_2.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_2.gridx = 2;
        	gbc_lblNewLabel_2.gridy = 8;
        	panelPc.add(lblNewLabel_2, gbc_lblNewLabel_2);
        	
        	JLabel lblNumeroDinamico_2 = new JLabel("numero dinamico");
        	GridBagConstraints gbc_lblNumeroDinamico_2 = new GridBagConstraints();
        	gbc_lblNumeroDinamico_2.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNumeroDinamico_2.gridx = 4;
        	gbc_lblNumeroDinamico_2.gridy = 8;
        	panelPc.add(lblNumeroDinamico_2, gbc_lblNumeroDinamico_2);
        	
        	panelPort = new JPanel();
        	frmProva.getContentPane().add(panelPort);
        	GridBagLayout gbl_panelPort = new GridBagLayout();
        	gbl_panelPort.columnWidths = new int[]{30, 30, 100, 30, 106, 30, 30, 0};
        	gbl_panelPort.rowHeights = new int[]{30, 30, 0, 14, 20, 35, 20, 35, 20, 35, 20, 30, 0, 30, 0};
        	gbl_panelPort.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	gbl_panelPort.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panelPort.setLayout(gbl_panelPort);
        	
        	JLabel lblSetYouCommunication = new JLabel("Set you communication way:");
        	lblSetYouCommunication.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblSetYouCommunication = new GridBagConstraints();
        	gbc_lblSetYouCommunication.gridwidth = 3;
        	gbc_lblSetYouCommunication.insets = new Insets(0, 0, 5, 5);
        	gbc_lblSetYouCommunication.gridx = 2;
        	gbc_lblSetYouCommunication.gridy = 1;
        	panelPort.add(lblSetYouCommunication, gbc_lblSetYouCommunication);
        	
        	JLabel lblThisSettingsWill = new JLabel("this settings will be used to send and receive messages");
        	lblThisSettingsWill.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblThisSettingsWill = new GridBagConstraints();
        	gbc_lblThisSettingsWill.gridwidth = 3;
        	gbc_lblThisSettingsWill.insets = new Insets(0, 0, 5, 5);
        	gbc_lblThisSettingsWill.gridx = 2;
        	gbc_lblThisSettingsWill.gridy = 2;
        	panelPort.add(lblThisSettingsWill, gbc_lblThisSettingsWill);
        	
        	JSeparator separator_12 = new JSeparator();
        	GridBagConstraints gbc_separator_12 = new GridBagConstraints();
        	gbc_separator_12.gridwidth = 5;
        	gbc_separator_12.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_12.anchor = GridBagConstraints.NORTH;
        	gbc_separator_12.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_12.gridx = 1;
        	gbc_separator_12.gridy = 3;
        	panelPort.add(separator_12, gbc_separator_12);
        	
        	JLabel lblNewLabel_3 = new JLabel("IP Address");
        	GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints();
        	gbc_lblNewLabel_3.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_3.gridx = 2;
        	gbc_lblNewLabel_3.gridy = 4;
        	panelPort.add(lblNewLabel_3, gbc_lblNewLabel_3);
        	
        	JLabel lblYourIp = new JLabel("your ip");
        	GridBagConstraints gbc_lblYourIp = new GridBagConstraints();
        	gbc_lblYourIp.insets = new Insets(0, 0, 5, 5);
        	gbc_lblYourIp.gridx = 4;
        	gbc_lblYourIp.gridy = 4;
        	panelPort.add(lblYourIp, gbc_lblYourIp);
        	
        	JLabel lblNewLabel_4 = new JLabel("Task port:");
        	GridBagConstraints gbc_lblNewLabel_4 = new GridBagConstraints();
        	gbc_lblNewLabel_4.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_4.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_4.gridx = 2;
        	gbc_lblNewLabel_4.gridy = 6;
        	panelPort.add(lblNewLabel_4, gbc_lblNewLabel_4);
        	
        	JTextField textField_4 = new JTextField();
        	GridBagConstraints gbc_textField_4 = new GridBagConstraints();
        	gbc_textField_4.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_4.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_4.gridx = 4;
        	gbc_textField_4.gridy = 6;
        	panelPort.add(textField_4, gbc_textField_4);
        	textField_4.setColumns(10);
        	
        	JLabel lblNewLabel_5 = new JLabel("Event port:");
        	GridBagConstraints gbc_lblNewLabel_5 = new GridBagConstraints();
        	gbc_lblNewLabel_5.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_5.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_5.gridx = 2;
        	gbc_lblNewLabel_5.gridy = 8;
        	panelPort.add(lblNewLabel_5, gbc_lblNewLabel_5);
        	
        	JTextField textField_5 = new JTextField();
        	GridBagConstraints gbc_textField_5 = new GridBagConstraints();
        	gbc_textField_5.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_5.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_5.gridx = 4;
        	gbc_textField_5.gridy = 8;
        	panelPort.add(textField_5, gbc_textField_5);
        	textField_5.setColumns(10);
        	
        	JLabel lblNewLabel_6 = new JLabel("File Server port:");
        	GridBagConstraints gbc_lblNewLabel_6 = new GridBagConstraints();
        	gbc_lblNewLabel_6.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_6.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_6.gridx = 2;
        	gbc_lblNewLabel_6.gridy = 10;
        	panelPort.add(lblNewLabel_6, gbc_lblNewLabel_6);
        	
        	JTextField textField_6 = new JTextField();
        	GridBagConstraints gbc_textField_6 = new GridBagConstraints();
        	gbc_textField_6.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_6.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_6.gridx = 4;
        	gbc_textField_6.gridy = 10;
        	panelPort.add(textField_6, gbc_textField_6);
        	textField_6.setColumns(10);
        	
        	JButton btnConfirm_2 = new JButton("CONFIRM");
        	btnConfirm_2.addMouseListener(new MouseAdapter() {
        		@Override
        		public void mouseReleased(MouseEvent e) {
        			// TODO: send event local
        		}
        	});
        	GridBagConstraints gbc_btnConfirm_2 = new GridBagConstraints();
        	gbc_btnConfirm_2.gridwidth = 3;
        	gbc_btnConfirm_2.insets = new Insets(0, 0, 5, 5);
        	gbc_btnConfirm_2.gridx = 2;
        	gbc_btnConfirm_2.gridy = 12;
        	panelPort.add(btnConfirm_2, gbc_btnConfirm_2);
        	
        	panelQueue = new JPanel();
        	frmProva.getContentPane().add(panelQueue);
        	GridBagLayout gbl_panelQueue = new GridBagLayout();
        	gbl_panelQueue.columnWidths = new int[]{20, 100, 140, 20, 100, 140, 35, 20, 0};
        	gbl_panelQueue.rowHeights = new int[]{30, 0, 30, 23, 30, 21, 21, 21, 20, 20, 0, 20, 0};
        	gbl_panelQueue.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
        	gbl_panelQueue.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panelQueue.setLayout(gbl_panelQueue);
        	
        	JLabel lblSettingsOfYour = new JLabel("Settings of your personal queue: size, timeout and number of elements");
        	lblSettingsOfYour.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblSettingsOfYour = new GridBagConstraints();
        	gbc_lblSettingsOfYour.gridwidth = 6;
        	gbc_lblSettingsOfYour.insets = new Insets(0, 0, 5, 5);
        	gbc_lblSettingsOfYour.gridx = 1;
        	gbc_lblSettingsOfYour.gridy = 1;
        	panelQueue.add(lblSettingsOfYour, gbc_lblSettingsOfYour);
        	
        	JSeparator separator_10 = new JSeparator();
        	GridBagConstraints gbc_separator_10 = new GridBagConstraints();
        	gbc_separator_10.anchor = GridBagConstraints.NORTH;
        	gbc_separator_10.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_10.gridwidth = 6;
        	gbc_separator_10.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_10.gridx = 1;
        	gbc_separator_10.gridy = 2;
        	panelQueue.add(separator_10, gbc_separator_10);
        	
        	JLabel lblIsubmission_1 = new JLabel("I_submission");
        	GridBagConstraints gbc_lblIsubmission_1 = new GridBagConstraints();
        	gbc_lblIsubmission_1.anchor = GridBagConstraints.EAST;
        	gbc_lblIsubmission_1.insets = new Insets(0, 0, 5, 5);
        	gbc_lblIsubmission_1.gridx = 1;
        	gbc_lblIsubmission_1.gridy = 3;
        	panelQueue.add(lblIsubmission_1, gbc_lblIsubmission_1);
        	
        	final JLabel label = new JLabel("50%");
        	GridBagConstraints gbc_label = new GridBagConstraints();
        	gbc_label.anchor = GridBagConstraints.EAST;
        	gbc_label.insets = new Insets(0, 0, 5, 5);
        	gbc_label.gridx = 6;
        	gbc_label.gridy = 3;
        	panelQueue.add(label, gbc_label);
        	
        	JSlider slider = new JSlider();
        	slider.setToolTipText("");
        	GridBagConstraints gbc_slider = new GridBagConstraints();
        	gbc_slider.gridwidth = 4;
        	gbc_slider.anchor = GridBagConstraints.NORTH;
        	gbc_slider.fill = GridBagConstraints.HORIZONTAL;
        	gbc_slider.insets = new Insets(0, 0, 5, 5);
        	gbc_slider.gridx = 2;
        	gbc_slider.gridy = 3;
        	ChangeListener sizeAction=new ChangeListener(){
                public void stateChanged (ChangeEvent event){
                    JSlider slider=(JSlider)event.getSource();
                    int value = slider.getValue();
    	        	label.setText(""+value+"%");
                }
            };
            slider.addChangeListener(sizeAction);
        	panelQueue.add(slider, gbc_slider);
        	
        	JLabel lblNewLabel_8 = new JLabel("isize");
        	GridBagConstraints gbc_lblNewLabel_8 = new GridBagConstraints();
        	gbc_lblNewLabel_8.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_8.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_8.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_8.gridx = 1;
        	gbc_lblNewLabel_8.gridy = 5;
        	panelQueue.add(lblNewLabel_8, gbc_lblNewLabel_8);
        	
        	JTextField textField_7 = new JTextField();
        	GridBagConstraints gbc_textField_7 = new GridBagConstraints();
        	gbc_textField_7.fill = GridBagConstraints.BOTH;
        	gbc_textField_7.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_7.gridx = 2;
        	gbc_textField_7.gridy = 5;
        	panelQueue.add(textField_7, gbc_textField_7);
        	textField_7.setColumns(10);
        	
        	JLabel lblNewLabel_9 = new JLabel("esize");
        	GridBagConstraints gbc_lblNewLabel_9 = new GridBagConstraints();
        	gbc_lblNewLabel_9.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_9.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_9.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_9.gridx = 1;
        	gbc_lblNewLabel_9.gridy = 6;
        	panelQueue.add(lblNewLabel_9, gbc_lblNewLabel_9);
        	
        	JTextField textField_8 = new JTextField();
        	textField_8.setColumns(10);
        	GridBagConstraints gbc_textField_8 = new GridBagConstraints();
        	gbc_textField_8.fill = GridBagConstraints.BOTH;
        	gbc_textField_8.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_8.gridx = 2;
        	gbc_textField_8.gridy = 6;
        	panelQueue.add(textField_8, gbc_textField_8);
        	
        	JLabel lblNewLabel_10 = new JLabel("N\u00B0 Task max:");
        	GridBagConstraints gbc_lblNewLabel_10 = new GridBagConstraints();
        	gbc_lblNewLabel_10.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_10.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_10.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_10.gridx = 1;
        	gbc_lblNewLabel_10.gridy = 7;
        	panelQueue.add(lblNewLabel_10, gbc_lblNewLabel_10);
        	
        	JTextField textField_9 = new JTextField();
        	textField_9.setColumns(10);
        	GridBagConstraints gbc_textField_9 = new GridBagConstraints();
        	gbc_textField_9.fill = GridBagConstraints.BOTH;
        	gbc_textField_9.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_9.gridx = 2;
        	gbc_textField_9.gridy = 7;
        	panelQueue.add(textField_9, gbc_textField_9);
        	
        	JLabel lblItimeout = new JLabel("Task timeout:");
        	GridBagConstraints gbc_lblItimeout = new GridBagConstraints();
        	gbc_lblItimeout.anchor = GridBagConstraints.EAST;
        	gbc_lblItimeout.insets = new Insets(0, 0, 5, 5);
        	gbc_lblItimeout.gridx = 4;
        	gbc_lblItimeout.gridy = 7;
        	panelQueue.add(lblItimeout, gbc_lblItimeout);
        	
        	JTextField textField_19 = new JTextField();
        	GridBagConstraints gbc_textField_19 = new GridBagConstraints();
        	gbc_textField_19.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_19.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_19.gridx = 5;
        	gbc_textField_19.gridy = 7;
        	panelQueue.add(textField_19, gbc_textField_19);
        	textField_19.setColumns(10);
        	
        	JLabel lblNewLabel_11 = new JLabel("N\u00B0 Event max:");
        	GridBagConstraints gbc_lblNewLabel_11 = new GridBagConstraints();
        	gbc_lblNewLabel_11.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_11.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_11.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_11.gridx = 1;
        	gbc_lblNewLabel_11.gridy = 8;
        	panelQueue.add(lblNewLabel_11, gbc_lblNewLabel_11);
        	
        	JTextField textField_10 = new JTextField();
        	textField_10.setColumns(10);
        	GridBagConstraints gbc_textField_10 = new GridBagConstraints();
        	gbc_textField_10.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_10.anchor = GridBagConstraints.NORTH;
        	gbc_textField_10.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_10.gridx = 2;
        	gbc_textField_10.gridy = 8;
        	panelQueue.add(textField_10, gbc_textField_10);
        	
        	JLabel lblEtimeout = new JLabel("Event Timeout:");
        	GridBagConstraints gbc_lblEtimeout = new GridBagConstraints();
        	gbc_lblEtimeout.anchor = GridBagConstraints.EAST;
        	gbc_lblEtimeout.insets = new Insets(0, 0, 5, 5);
        	gbc_lblEtimeout.gridx = 4;
        	gbc_lblEtimeout.gridy = 8;
        	panelQueue.add(lblEtimeout, gbc_lblEtimeout);
        	
        	JTextField textField_20 = new JTextField();
        	GridBagConstraints gbc_textField_20 = new GridBagConstraints();
        	gbc_textField_20.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_20.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_20.gridx = 5;
        	gbc_textField_20.gridy = 8;
        	panelQueue.add(textField_20, gbc_textField_20);
        	textField_20.setColumns(10);
        	
        	JButton btnConfirm_1 = new JButton("CONFIRM");
        	btnConfirm_1.addMouseListener(new MouseAdapter() {
        		@Override
        		public void mouseReleased(MouseEvent e) {
        			// TODO: send event local
        		}
        	});
        	GridBagConstraints gbc_btnConfirm_1 = new GridBagConstraints();
        	gbc_btnConfirm_1.gridwidth = 6;
        	gbc_btnConfirm_1.insets = new Insets(0, 0, 5, 5);
        	gbc_btnConfirm_1.gridx = 1;
        	gbc_btnConfirm_1.gridy = 10;
        	panelQueue.add(btnConfirm_1, gbc_btnConfirm_1);
        	
        	panelParameter = new JPanel();
        	frmProva.getContentPane().add(panelParameter);
        	GridBagLayout gbl_panelParameter = new GridBagLayout();
        	gbl_panelParameter.columnWidths = new int[]{20, 90, 110, 20, 11, 20, 90, 90, 20, 0};
        	gbl_panelParameter.rowHeights = new int[]{20, 0, 30, 0, 20, 20, 0, 0, 0, 0, 0, 30, 0, 30, 0};
        	gbl_panelParameter.columnWeights = new double[]{0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE};
        	gbl_panelParameter.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panelParameter.setLayout(gbl_panelParameter);
        	
        	JLabel lblNoteIfYou = new JLabel("NOTE: if you want to execute event LOCALLY go to the CONFIGURATION menu");
        	lblNoteIfYou.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblNoteIfYou = new GridBagConstraints();
        	gbc_lblNoteIfYou.gridwidth = 7;
        	gbc_lblNoteIfYou.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNoteIfYou.gridx = 1;
        	gbc_lblNoteIfYou.gridy = 1;
        	panelParameter.add(lblNoteIfYou, gbc_lblNoteIfYou);
        	
        	JSeparator separator_13 = new JSeparator();
        	GridBagConstraints gbc_separator_13 = new GridBagConstraints();
        	gbc_separator_13.anchor = GridBagConstraints.NORTH;
        	gbc_separator_13.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_13.gridwidth = 7;
        	gbc_separator_13.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_13.gridx = 1;
        	gbc_separator_13.gridy = 2;
        	panelParameter.add(separator_13, gbc_separator_13);
        	
        	JLabel lblPortSection = new JLabel("PORT SECTION");
        	lblPortSection.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblPortSection = new GridBagConstraints();
        	gbc_lblPortSection.gridwidth = 2;
        	gbc_lblPortSection.insets = new Insets(0, 0, 5, 5);
        	gbc_lblPortSection.gridx = 1;
        	gbc_lblPortSection.gridy = 3;
        	panelParameter.add(lblPortSection, gbc_lblPortSection);
        	
        	JLabel lblQueueSection = new JLabel("QUEUE SECTION");
        	lblQueueSection.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblQueueSection = new GridBagConstraints();
        	gbc_lblQueueSection.gridwidth = 2;
        	gbc_lblQueueSection.insets = new Insets(0, 0, 5, 5);
        	gbc_lblQueueSection.gridx = 6;
        	gbc_lblQueueSection.gridy = 3;
        	panelParameter.add(lblQueueSection, gbc_lblQueueSection);
        	
        	JLabel lblTaskPort = new JLabel("Task port:");
        	GridBagConstraints gbc_lblTaskPort = new GridBagConstraints();
        	gbc_lblTaskPort.anchor = GridBagConstraints.EAST;
        	gbc_lblTaskPort.fill = GridBagConstraints.VERTICAL;
        	gbc_lblTaskPort.insets = new Insets(0, 0, 5, 5);
        	gbc_lblTaskPort.gridx = 1;
        	gbc_lblTaskPort.gridy = 5;
        	panelParameter.add(lblTaskPort, gbc_lblTaskPort);
        	
        	JTextField textField_11 = new JTextField();
        	GridBagConstraints gbc_textField_11 = new GridBagConstraints();
        	gbc_textField_11.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_11.fill = GridBagConstraints.BOTH;
        	gbc_textField_11.gridx = 2;
        	gbc_textField_11.gridy = 5;
        	panelParameter.add(textField_11, gbc_textField_11);
        	textField_11.setColumns(10);
        	
        	JSeparator separator_8 = new JSeparator();
        	separator_8.setOrientation(SwingConstants.VERTICAL);
        	//separator_8.setOrientation(SwingConstants.VERTICAL);
        	GridBagConstraints gbc_separator_8 = new GridBagConstraints();
        	gbc_separator_8.fill = GridBagConstraints.BOTH;
        	gbc_separator_8.fill = GridBagConstraints.VERTICAL;
        	gbc_separator_8.gridheight = 8;
        	gbc_separator_8.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_8.gridx = 4;
        	gbc_separator_8.gridy = 3;
        	panelParameter.add(separator_8, gbc_separator_8);
        	
        	JLabel lblNThreadsMax = new JLabel("N\u00B0 Threads max:");
        	GridBagConstraints gbc_lblNThreadsMax = new GridBagConstraints();
        	gbc_lblNThreadsMax.anchor = GridBagConstraints.EAST;
        	gbc_lblNThreadsMax.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNThreadsMax.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNThreadsMax.gridx = 6;
        	gbc_lblNThreadsMax.gridy = 5;
        	panelParameter.add(lblNThreadsMax, gbc_lblNThreadsMax);
        	
        	JTextField textField_12 = new JTextField();
        	GridBagConstraints gbc_textField_12 = new GridBagConstraints();
        	gbc_textField_12.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_12.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_12.gridx = 7;
        	gbc_textField_12.gridy = 5;
        	panelParameter.add(textField_12, gbc_textField_12);
        	textField_12.setColumns(10);
        	
        	JLabel lblEventPort = new JLabel("Event port:");
        	GridBagConstraints gbc_lblEventPort = new GridBagConstraints();
        	gbc_lblEventPort.anchor = GridBagConstraints.EAST;
        	gbc_lblEventPort.fill = GridBagConstraints.VERTICAL;
        	gbc_lblEventPort.insets = new Insets(0, 0, 5, 5);
        	gbc_lblEventPort.gridx = 1;
        	gbc_lblEventPort.gridy = 6;
        	panelParameter.add(lblEventPort, gbc_lblEventPort);
        	
        	JTextField textField_13 = new JTextField();
        	GridBagConstraints gbc_textField_13 = new GridBagConstraints();
        	gbc_textField_13.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_13.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_13.gridx = 2;
        	gbc_textField_13.gridy = 6;
        	panelParameter.add(textField_13, gbc_textField_13);
        	textField_13.setColumns(10);
        	
        	JLabel lblNEventMax = new JLabel("N\u00B0 Event max:");
        	GridBagConstraints gbc_lblNEventMax = new GridBagConstraints();
        	gbc_lblNEventMax.anchor = GridBagConstraints.EAST;
        	gbc_lblNEventMax.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNEventMax.gridx = 6;
        	gbc_lblNEventMax.gridy = 6;
        	panelParameter.add(lblNEventMax, gbc_lblNEventMax);
        	
        	JTextField textField_18 = new JTextField();
        	GridBagConstraints gbc_textField_18 = new GridBagConstraints();
        	gbc_textField_18.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_18.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_18.gridx = 7;
        	gbc_textField_18.gridy = 6;
        	panelParameter.add(textField_18, gbc_textField_18);
        	textField_18.setColumns(10);
        	
        	JLabel lblFileServerPort = new JLabel("File Server port:");
        	GridBagConstraints gbc_lblFileServerPort = new GridBagConstraints();
        	gbc_lblFileServerPort.anchor = GridBagConstraints.EAST;
        	gbc_lblFileServerPort.insets = new Insets(0, 0, 5, 5);
        	gbc_lblFileServerPort.gridx = 1;
        	gbc_lblFileServerPort.gridy = 7;
        	panelParameter.add(lblFileServerPort, gbc_lblFileServerPort);
        	
        	JTextField textField_15 = new JTextField();
        	GridBagConstraints gbc_textField_15 = new GridBagConstraints();
        	gbc_textField_15.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_15.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_15.gridx = 2;
        	gbc_textField_15.gridy = 7;
        	panelParameter.add(textField_15, gbc_textField_15);
        	textField_15.setColumns(10);
        	
        	JLabel lblIsubmission = new JLabel("I_submission");
        	GridBagConstraints gbc_lblIsubmission = new GridBagConstraints();
        	gbc_lblIsubmission.insets = new Insets(0, 0, 5, 5);
        	gbc_lblIsubmission.gridx = 6;
        	gbc_lblIsubmission.gridy = 8;
        	panelParameter.add(lblIsubmission, gbc_lblIsubmission);
        	
        	JLabel lblTaskTimeout = new JLabel("Task timeout:");
        	GridBagConstraints gbc_lblTaskTimeout = new GridBagConstraints();
        	gbc_lblTaskTimeout.anchor = GridBagConstraints.EAST;
        	gbc_lblTaskTimeout.insets = new Insets(0, 0, 5, 5);
        	gbc_lblTaskTimeout.gridx = 1;
        	gbc_lblTaskTimeout.gridy = 9;
        	panelParameter.add(lblTaskTimeout, gbc_lblTaskTimeout);
        	
        	JTextField textField_16 = new JTextField();
        	GridBagConstraints gbc_textField_16 = new GridBagConstraints();
        	gbc_textField_16.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_16.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_16.gridx = 2;
        	gbc_textField_16.gridy = 9;
        	panelParameter.add(textField_16, gbc_textField_16);
        	textField_16.setColumns(10);
        	
        	final JLabel lblDynamicValue = new JLabel("50%");
        	GridBagConstraints gbc_lblDynamicValue = new GridBagConstraints();
        	gbc_lblDynamicValue.insets = new Insets(0, 0, 5, 5);
        	gbc_lblDynamicValue.gridx = 7;
        	gbc_lblDynamicValue.gridy = 10;
        	panelParameter.add(lblDynamicValue, gbc_lblDynamicValue);
        	
        	JSlider slider_1 = new JSlider();
        	GridBagConstraints gbc_slider_1 = new GridBagConstraints();
        	gbc_slider_1.gridwidth = 2;
        	gbc_slider_1.insets = new Insets(0, 0, 5, 5);
        	gbc_slider_1.gridx = 6;
        	gbc_slider_1.gridy = 9;
        	ChangeListener sizeAction2=new ChangeListener(){
                public void stateChanged (ChangeEvent event){
                    JSlider slider=(JSlider)event.getSource();
                    int value = slider.getValue();
    	        	lblDynamicValue.setText(""+value+"%");
                }
            };
            slider_1.addChangeListener(sizeAction2);
        	panelParameter.add(slider_1, gbc_slider_1);
        	
        	JLabel lblEventTimeout = new JLabel("Event timeout:");
        	GridBagConstraints gbc_lblEventTimeout = new GridBagConstraints();
        	gbc_lblEventTimeout.anchor = GridBagConstraints.EAST;
        	gbc_lblEventTimeout.insets = new Insets(0, 0, 5, 5);
        	gbc_lblEventTimeout.gridx = 1;
        	gbc_lblEventTimeout.gridy = 10;
        	panelParameter.add(lblEventTimeout, gbc_lblEventTimeout);
        	
        	JTextField textField_17 = new JTextField();
        	GridBagConstraints gbc_textField_17 = new GridBagConstraints();
        	gbc_textField_17.insets = new Insets(0, 0, 5, 5);
        	gbc_textField_17.fill = GridBagConstraints.HORIZONTAL;
        	gbc_textField_17.gridx = 2;
        	gbc_textField_17.gridy = 10;
        	panelParameter.add(textField_17, gbc_textField_17);
        	textField_17.setColumns(10);
        	
        	JButton btnConfirm = new JButton("CONFIRM");
        	btnConfirm.addMouseListener(new MouseAdapter() {
        		@Override
        		public void mouseReleased(MouseEvent e) {
        			// TODO: send event remote
        		}
        	});
        	GridBagConstraints gbc_btnConfirm = new GridBagConstraints();
        	gbc_btnConfirm.gridwidth = 5;
        	gbc_btnConfirm.insets = new Insets(0, 0, 5, 5);
        	gbc_btnConfirm.gridx = 2;
        	gbc_btnConfirm.gridy = 12;
        	panelParameter.add(btnConfirm, gbc_btnConfirm);
        	panelYourQueue = new JPanel();
        	frmProva.getContentPane().add(panelYourQueue);
        	GridBagLayout gbl_panelYourQueue = new GridBagLayout();
        	gbl_panelYourQueue.columnWidths = new int[]{20, 76, 105, 30, 100, 30, 96, 20, 0};
        	gbl_panelYourQueue.rowHeights = new int[]{30, 0, 13, 30, 2, 281, 12, 0};
        	gbl_panelYourQueue.columnWeights = new double[]{0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	gbl_panelYourQueue.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE};
        	panelYourQueue.setLayout(gbl_panelYourQueue);
        	
        	JLabel lblNewLabel_17 = new JLabel("View status of your queue and Nodes that insert a task in it");
        	lblNewLabel_17.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblNewLabel_17 = new GridBagConstraints();
        	gbc_lblNewLabel_17.gridwidth = 6;
        	gbc_lblNewLabel_17.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_17.gridx = 1;
        	gbc_lblNewLabel_17.gridy = 1;
        	panelYourQueue.add(lblNewLabel_17, gbc_lblNewLabel_17);
        	
        	JSeparator separator_1 = new JSeparator();
        	GridBagConstraints gbc_separator_1 = new GridBagConstraints();
        	gbc_separator_1.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_1.anchor = GridBagConstraints.NORTH;
        	gbc_separator_1.gridwidth = 6;
        	gbc_separator_1.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_1.gridx = 1;
        	gbc_separator_1.gridy = 2;
        	panelYourQueue.add(separator_1, gbc_separator_1);
        	JLabel lblNewLabel_7 = new JLabel("Element :");
        	lblNewLabel_7.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel_7_1 = new GridBagConstraints();
        	gbc_lblNewLabel_7_1.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_7_1.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_7_1.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_7_1.gridx = 1;
        	gbc_lblNewLabel_7_1.gridy = 3;
        	panelYourQueue.add(lblNewLabel_7, gbc_lblNewLabel_7_1);
        	
        	JLabel lblNElem = new JLabel("N ELEM");
        	GridBagConstraints gbc_lblNElem = new GridBagConstraints();
        	gbc_lblNElem.anchor = GridBagConstraints.WEST;
        	gbc_lblNElem.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNElem.gridx = 2;
        	gbc_lblNElem.gridy = 3;
        	panelYourQueue.add(lblNElem, gbc_lblNElem);
        	
        	JLabel lblNewLabel_15 = new JLabel("Free :");
        	lblNewLabel_15.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel_15 = new GridBagConstraints();
        	gbc_lblNewLabel_15.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_15.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_15.gridx = 3;
        	gbc_lblNewLabel_15.gridy = 3;
        	panelYourQueue.add(lblNewLabel_15, gbc_lblNewLabel_15);
        	
        	JLabel lblNFree = new JLabel("N FREE");
        	GridBagConstraints gbc_lblNFree = new GridBagConstraints();
        	gbc_lblNFree.anchor = GridBagConstraints.WEST;
        	gbc_lblNFree.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNFree.gridx = 4;
        	gbc_lblNFree.gridy = 3;
        	panelYourQueue.add(lblNFree, gbc_lblNFree);
        	
        	JLabel lblNewLabel_16 = new JLabel("Total :");
        	lblNewLabel_16.setFont(new Font("Tahoma", Font.PLAIN, 14));
        	GridBagConstraints gbc_lblNewLabel_16 = new GridBagConstraints();
        	gbc_lblNewLabel_16.anchor = GridBagConstraints.EAST;
        	gbc_lblNewLabel_16.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_16.gridx = 5;
        	gbc_lblNewLabel_16.gridy = 3;
        	panelYourQueue.add(lblNewLabel_16, gbc_lblNewLabel_16);
        	
        	JLabel lblTotQueue = new JLabel("TOT QUEUE");
        	GridBagConstraints gbc_lblTotQueue = new GridBagConstraints();
        	gbc_lblTotQueue.anchor = GridBagConstraints.WEST;
        	gbc_lblTotQueue.insets = new Insets(0, 0, 5, 5);
        	gbc_lblTotQueue.gridx = 6;
        	gbc_lblTotQueue.gridy = 3;
        	panelYourQueue.add(lblTotQueue, gbc_lblTotQueue);
        	
        	JSeparator separator_2 = new JSeparator();
        	GridBagConstraints gbc_separator_2_1 = new GridBagConstraints();
        	gbc_separator_2_1.anchor = GridBagConstraints.NORTH;
        	gbc_separator_2_1.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_2_1.insets = new Insets(0, 0, 5, 5);
        	gbc_separator_2_1.gridwidth = 6;
        	gbc_separator_2_1.gridx = 1;
        	gbc_separator_2_1.gridy = 4;
        	panelYourQueue.add(separator_2, gbc_separator_2_1);
        	
        	gbc_separator_2_1.anchor = GridBagConstraints.NORTH;
        	gbc_separator_2_1.fill = GridBagConstraints.HORIZONTAL;
        	gbc_separator_2_1.insets = new Insets(0, 0, 5, 0);
        	gbc_separator_2_1.gridwidth = 5;
        	gbc_separator_2_1.gridx = 0;
        	gbc_separator_2_1.gridy = 1;
        	
        	gbc_lblNewLabel_7_1.anchor = GridBagConstraints.WEST;
        	gbc_lblNewLabel_7_1.fill = GridBagConstraints.VERTICAL;
        	gbc_lblNewLabel_7_1.insets = new Insets(0, 0, 5, 5);
        	gbc_lblNewLabel_7_1.gridx = 0;
        	gbc_lblNewLabel_7_1.gridy = 0;
        	
        	JPanel panel_1 = new JPanel();
        	panel_1.setBackground(Color.WHITE);
        	panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));
        	GridBagConstraints gbc_panel_1 = new GridBagConstraints();
        	gbc_panel_1.gridwidth = 6;
        	gbc_panel_1.insets = new Insets(0, 0, 5, 5);
        	gbc_panel_1.fill = GridBagConstraints.BOTH;
        	gbc_panel_1.gridx = 1;
        	gbc_panel_1.gridy = 5;
        	panelYourQueue.add(panel_1, gbc_panel_1);
        	GridBagLayout gbl_panel_1 = new GridBagLayout();
        	gbl_panel_1.columnWidths = new int[]{152, 152, 152, 0};
        	gbl_panel_1.rowHeights = new int[]{280, 0};
        	gbl_panel_1.columnWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
        	gbl_panel_1.rowWeights = new double[]{0.0, Double.MIN_VALUE};
        	panel_1.setLayout(gbl_panel_1);
        	
        	JLabel lblTask_1 = new JLabel("TASK");
        	lblTask_1.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblTask_1 = new GridBagConstraints();
        	gbc_lblTask_1.anchor = GridBagConstraints.NORTH;
        	gbc_lblTask_1.insets = new Insets(0, 0, 0, 5);
        	gbc_lblTask_1.gridx = 0;
        	gbc_lblTask_1.gridy = 0;
        	panel_1.add(lblTask_1, gbc_lblTask_1);
        	
        	JLabel lblSender = new JLabel("SENDER");
        	lblSender.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblSender = new GridBagConstraints();
        	gbc_lblSender.anchor = GridBagConstraints.NORTH;
        	gbc_lblSender.insets = new Insets(0, 0, 0, 5);
        	gbc_lblSender.gridx = 1;
        	gbc_lblSender.gridy = 0;
        	panel_1.add(lblSender, gbc_lblSender);
        	
        	JLabel lblPriority = new JLabel("PRIORITY");
        	lblPriority.setFont(new Font("Tahoma", Font.BOLD, 14));
        	GridBagConstraints gbc_lblPriority = new GridBagConstraints();
        	gbc_lblPriority.anchor = GridBagConstraints.NORTH;
        	gbc_lblPriority.gridx = 2;
        	gbc_lblPriority.gridy = 0;
        	panel_1.add(lblPriority, gbc_lblPriority);
        }
        
        public JPanel getPanel(String p){
        	JPanel panel = null;
        	if(p.equalsIgnoreCase("panelPc")) panel = panelPc;
        	if(p.equalsIgnoreCase("panelPort")) panel = panelPort;
        	if(p.equalsIgnoreCase("panelQueue")) panel = panelQueue;
        	if(p.equalsIgnoreCase("panelTask")) panel = panelTask;
        	if(p.equalsIgnoreCase("panelYourQueue")) panel = panelYourQueue;
        	if(p.equalsIgnoreCase("panelSent")) panel = panelSent;
        	if(p.equalsIgnoreCase("panelParameter")) panel = panelParameter;
        	return panel;
        }
}
